<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="../assets/js/vue.js"></script>
</head>
<body>
    <div id="app">
        <input type="button" value="打印this.$el" @click="printEl()">
        <input type="button" value="打印this.$data" @click="printData()">
        <input type="button" value="打印this.$options" @click="printOption()">
        <div ref="divA">
            <div>
                <div>11</div>
            </div>
        </div>
        <input type="button" value="打印this.$options" @click="printRef()"> 
    </div>
    <script>
        let vm=new Vue({
            el:"#app",
            data:{
                    msg:"默认数据",
                    arr:[1,2,3],
                    user:{
                        name:"rick",age:18
                    },
                    num:20
                    
            },
            methods: {
                printEl(){
                    console.log(this.$el);
                },
                printData(){
                    console.log(this.$data);
                },
                printOption(){
                    console.log(this.$options);
                },
                printRef(){
                    console.log(this.$refs.divA)
                }
            },
        })
    </script>
</body>
</html>